<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
<f:view contentType="text/html">
	<h:head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link rel="stylesheet"
			href="${request.contextPath}/resources/css/style.css" type="text/css"
			media="screen" />
		<link rel="stylesheet"
			href="${request.contextPath}/resources/css/styleButton.css"
			type="text/css" media="screen" />
		<link rel="shortcut icon"
			href="${request.contextPath}/resources/img/favicon.ico" />
		<title><ui:insert name="title"></ui:insert></title>
	</h:head>
	<h:body>
		<div id="page">
			<div id="menu">
				<ui:insert name="header">
					<center>
						<ui:include src="/template/commonHeader.xhtml" />
					</center>
				</ui:insert>
			</div>
			<div id="line" />
			<div id="content">
				<!-- List All User -->
				<h:form id="formListAllRoles">
					<p:messages />
					<p:dataTable id="listDatatable" var="rolesList"
						value="#{rolesController.rolesList}"
						style="width:96%; padding-top: 3px; padding-bottom: 3px; padding-left: 2%;  vertical-align: top;"
						draggableColumns="true" resizableColumns="true">

						<p:column headerText="ID">
							<h:outputText value="#{rolesList.roles_id}" />
						</p:column>

						<p:column headerText="ROLES">
							<h:outputText value="#{rolesList.description}" />
						</p:column>

						<p:column style="width:6%;" headerText="EDIT">
							<p:commandButton update=":formEditRoles:panelEditGrid"
								oncomplete="rolesEditDialog.show()" icon="ui-icon-wrench"
								title="Edit"
								action="#{rolesController.preparedUpdateRoles(rolesList.roles_id)}" />&nbsp;&nbsp;
						</p:column>

					</p:dataTable>
				</h:form>

				<h:form id="formEditRoles">
					<p:dialog header="Edit Roles Informatiom" id="rolesEditDialog"
						widgetVar="rolesEditDialog" resizable="true" modal="true"
						showEffect="explode" hideEffect="explode" styleClass="dialogback">
						<p:growl id="growlEdit" showDetail="true" sticky="true" />
						<h:panelGrid id="panelEditGrid" columns="4" cellpadding="4">

							<f:facet name="header">
								<h:outputText value="#{rolesController.roles.description}" />
							</f:facet>

							<br />
							<h:outputText value="Profil Actions " />
							<h:outputLabel value="" />
							<br />
							<h:panelGroup>
								<h:outputText value="Profil  Actions" />
								<h:outputText style="color:red; float: right" value=" = " />
							</h:panelGroup>
							<p:selectBooleanCheckbox
								value="#{rolesController.roles.profil_actions}"
								style="font-weight:bold" />
							<h:outputLabel value="" />
							<h:outputLabel value="" />

							<br />
							<h:outputText value="User Actions " />
							<h:outputLabel value="" />
							<br />
							<h:panelGroup>
								<h:outputText value="User Actions" />
								<h:outputText style="color:red; float: right" value=" = " />
							</h:panelGroup>
							<p:selectBooleanCheckbox
								value="#{rolesController.roles.user_actions}"
								style="font-weight:bold" />
							<h:panelGroup>
								<h:outputText value="All User" />
								<h:outputText style="color:red; float: right" value=" = " />
							</h:panelGroup>
							<p:selectBooleanCheckbox
								value="#{rolesController.roles.all_user}"
								style="font-weight:bold" />

							<h:panelGroup>
								<h:outputText value="All Teacher" />
								<h:outputText style="color:red; float: right" value=" = " />
							</h:panelGroup>
							<p:selectBooleanCheckbox
								value="#{rolesController.roles.all_teacher}"
								style="font-weight:bold" />
							<h:panelGroup>
								<h:outputText value="All Student" />
								<h:outputText style="color:red; float: right" value=" = " />
							</h:panelGroup>
							<p:selectBooleanCheckbox
								value="#{rolesController.roles.all_student}"
								style="font-weight:bold" />

							<h:panelGroup>
								<h:outputText value="All Lessons" />
								<h:outputText style="color:red; float: right" value=" = " />
							</h:panelGroup>
							<p:selectBooleanCheckbox
								value="#{rolesController.roles.all_lesson}"
								style="font-weight:bold" />
							<h:panelGroup>
								<h:outputText value="Semester For Lessons" />
								<h:outputText style="color:red; float: right" value=" = " />
							</h:panelGroup>
							<p:selectBooleanCheckbox
								value="#{rolesController.roles.semester_lessons}"
								style="font-weight:bold" />

							<h:panelGroup>
								<h:outputText value="Semester For Notes" />
								<h:outputText style="color:red; float: right" value=" = " />
							</h:panelGroup>
							<p:selectBooleanCheckbox
								value="#{rolesController.roles.semester_notes}"
								style="font-weight:bold" />
							<h:panelGroup>
								<h:outputText value="Teacher and Lessons" />
								<h:outputText style="color:red; float: right" value=" = " />
							</h:panelGroup>
							<p:selectBooleanCheckbox
								value="#{rolesController.roles.adding_lesson_teacher}"
								style="font-weight:bold" />


							<br />
							<h:outputText value="Teacher Affairs " />
							<h:outputLabel value="" />
							<br />
							<h:panelGroup>
								<h:outputText value="Teacher Affairs" />
								<h:outputText style="color:red; float: right" value=" = " />
							</h:panelGroup>
							<p:selectBooleanCheckbox
								value="#{rolesController.roles.teacher_affairs}"
								style="font-weight:bold" />
							<h:panelGroup>
								<h:outputText value="All Project" />
								<h:outputText style="color:red; float: right" value=" = " />
							</h:panelGroup>
							<p:selectBooleanCheckbox
								value="#{rolesController.roles.all_project}"
								style="font-weight:bold" />

							<h:panelGroup>
								<h:outputText value="Lesson Notes" />
								<h:outputText style="color:red; float: right" value=" = " />
							</h:panelGroup>
							<p:selectBooleanCheckbox
								value="#{rolesController.roles.notes_lesson}"
								style="font-weight:bold" />
							<h:panelGroup>
								<h:outputText value="Project Notes" />
								<h:outputText style="color:red; float: right" value=" = " />
							</h:panelGroup>
							<p:selectBooleanCheckbox
								value="#{rolesController.roles.notes_project}"
								style="font-weight:bold" />


							<br />
							<h:outputText value="Student Affairs " />
							<h:outputLabel value="" />
							<br />
							<h:panelGroup>
								<h:outputText value="Choose Lesson" />
								<h:outputText style="color:red; float: right" value=" = " />
							</h:panelGroup>
							<p:selectBooleanCheckbox
								value="#{rolesController.roles.choose_lesson}"
								style="font-weight:bold" />
							<h:panelGroup>
								<h:outputText value="Choose Project" />
								<h:outputText style="color:red; float: right" value=" = " />
							</h:panelGroup>
							<p:selectBooleanCheckbox
								value="#{rolesController.roles.choose_project}"
								style="font-weight:bold" />

							<br />
							<h:outputText value="Account Setting " />
							<h:outputLabel value="" />
							<br />
							<h:panelGroup>
								<h:outputText value="Accout Settings" />
								<h:outputText style="color:red; float: right" value=" = " />
							</h:panelGroup>
							<p:selectBooleanCheckbox
								value="#{rolesController.roles.account_settings}"
								style="font-weight:bold" />
							<h:panelGroup>
								<h:outputText value="Change Password" />
								<h:outputText style="color:red; float: right" value=" = " />
							</h:panelGroup>
							<p:selectBooleanCheckbox
								value="#{rolesController.roles.change_password}"
								style="font-weight:bold" />
							<h:panelGroup>
								<h:outputText value="Edit Profil" />
								<h:outputText style="color:red; float: right" value=" = " />
							</h:panelGroup>
							<p:selectBooleanCheckbox
								value="#{rolesController.roles.edit_profil}"
								style="font-weight:bold" />
							<h:panelGroup>
								<h:outputText value="Delete Account" />
								<h:outputText style="color:red; float: right" value=" = " />
							</h:panelGroup>
							<p:selectBooleanCheckbox
								value="#{rolesController.roles.delete_account}"
								style="font-weight:bold" />

							<br />
							<h:outputText value="Form and Panel Rendered Actions " />
							<h:outputLabel value="" />
							<br />
							<h:panelGroup>
								<h:outputText value="Panel Admin" />
								<h:outputText style="color:red; float: right" value=" = " />
							</h:panelGroup>
							<p:selectBooleanCheckbox
								value="#{rolesController.roles.panel_admin}"
								style="font-weight:bold" />
							<h:panelGroup>
								<h:outputText value="Panel Teacher" />
								<h:outputText style="color:red; float: right" value=" = " />
							</h:panelGroup>
							<p:selectBooleanCheckbox
								value="#{rolesController.roles.panel_teacher}"
								style="font-weight:bold" />

							<h:panelGroup>
								<h:outputText value="Panel Student" />
								<h:outputText style="color:red; float: right" value=" = " />
							</h:panelGroup>
							<p:selectBooleanCheckbox
								value="#{rolesController.roles.panel_student}"
								style="font-weight:bold" />
							<h:panelGroup>
								<h:outputText value="Form Add Student" />
								<h:outputText style="color:red; float: right" value=" = " />
							</h:panelGroup>
							<p:selectBooleanCheckbox
								value="#{rolesController.roles.form_new_student}"
								style="font-weight:bold" />

							<h:panelGroup>
								<h:outputText value="Form Add Teacher" />
								<h:outputText style="color:red; float: right" value=" = " />
							</h:panelGroup>
							<p:selectBooleanCheckbox
								value="#{rolesController.roles.form_new_teacher}"
								style="font-weight:bold" />
						</h:panelGrid>
						<p:separator />
						<p:separator />
						<p:commandButton value="&nbsp;#{Button.update_btn}"
							update=":formListAllRoles:listDatatable, growlEdit, rolesEditDialog"
							actionListener="#{rolesController.update}"
							oncomplete="rolesEditDialog.hide()" icon="ui-icon-disk"
							style="margin-left:40%;" />&nbsp;&nbsp;
                		<p:commandButton value="&nbsp;#{Button.cancel_button}"
							update=":formListAllRoles:listDatatable"
							oncomplete="rolesEditDialog.hide()" icon="ui-icon-circle-close" />
					</p:dialog>
				</h:form>
			</div>
			<div id="line" />
			<br />
			<div id="footer">
				<ui:insert name="footer">
					<ui:include src="/template/commonDock.xhtml" />
				</ui:insert>
			</div>
		</div>
	</h:body>
</f:view>
</html>
